# result1 = input("请输入第一个数字：")
# result2 = input("请输入第一个数字：")
# num = int (result1) + int (result2)
# print(num)
import randoms

# age = input("请输入年龄：")
# if int(age) >= 18:
#     print("可以去酒吧玩")
# else:
#     print("不可以")

# name = input("name")
# password = input("password")
# if name == 'admin' and password == '123456':
#     print("success")

# score = int(input('请输入你的分数: '))
#
# if score >= 90:
#     print('优')
# elif score >= 80:
#     print('良')
# elif score >= 70:
#     print('中')
# elif score >= 60:
#     print('差')
# else:
#     print('不及格')
# i = 1
# num = 0
# while i <= 100:
#     if i % 2 == 0:
#         num += i
#     i += 1
# print(num)

# my_str = 'hello'
# for i in my_str:
#     print(i)
# print("_" * 30)
# for i in range(10):
#     print(i)
# 切片 获取字符串中多个字符（字符需要等差数列）
# 字符串[start:end:step]
str1 = "helloword hello"
print(len(str1))
print(str1[1:14:2])
print(str1.find("hello", 1, 15))
print(str1)
# str2 = str1.replace("h","H")
# str2 = str2.replace("H","h",1)
# print(str2)
str2 = str1.split('h')
print(str2)
list1 = ['', 'ello', 'word', 'ello']
str3 = ''.join(list1)
print(str3)
# str3 = ' and '.join(list1)
# print(str3)
list1[0] = 1
print(list1)
tuple2 = tuple()
print(type(tuple2), tuple2)
tuple1 = (1,)
print(tuple1)
a = 1
b = 2
a, b = b, a
print(a, b)
# 字典
my_dict1 = dict()
print(type(my_dict1), my_dict1)
my_dict2 = {"name": "xiaoming", "age": 18, "sex": "male"}
print(my_dict2)
my_dict2["age"] = 20
print(my_dict2)
my_dict2.pop("age")
print(my_dict2)
print(my_dict2.get("age"))
for data in my_dict2:
    print(data)
print("_"*30)
for data1,data2 in my_dict2.items():
    print(data1,data2)
print("_"*30)
for data in my_dict2.values() :
    print(data)
for data in my_dict2.keys():
    print(data)